package com.yww.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 模块实体类
 * </p>
 *
 * @author jobob杨雯雯
 * @since 2020-05-20
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Modules对象", description="")
public class Modules implements Serializable {

    private static final long serialVersionUID = 1L;
    @TableId(type = IdType.AUTO)
    @JsonProperty("id")
    private Integer modId;

    @JsonProperty("title")//(1.改映射 2.改变数据格式)数据库和是实体类不变 展示在页面上的时候title
    private String modName;

    private Integer parentId;

    private String path;

    private Double weight;

    //是否被选中
    @TableField(exist = false)
    private boolean checked;//树形菜单要被选中

    //子模块们
    @TableField(exist = false)
    private List<Modules> children;

}
